package com.arron.simplefactory.pizzastore.improve;

import com.arron.simplefactory.pizzastore.CheesePizza;
import com.arron.simplefactory.pizzastore.GreekPizza;
import com.arron.simplefactory.pizzastore.PepperPizza;
import com.arron.simplefactory.pizzastore.Pizza;

public class FactoryPizza {
    public Pizza getPizza(String type){
        if(type.equalsIgnoreCase("greek")) {
            return new GreekPizza();
        }
        if(type.equalsIgnoreCase("cheese")) {
            return new CheesePizza();
        }
        if(type.equalsIgnoreCase("pepper")) {
            return new PepperPizza();
        }
        return null;
    }


}
